package com.itheima.config;

import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TomcatConfig {
    @Bean
    public TomcatServletWebServerFactory tomcatServletWebServerFactory() {
        System.out.println("配置类执行了!");
        TomcatServletWebServerFactory tomcatServletWebServerFactory = new TomcatServletWebServerFactory();
        tomcatServletWebServerFactory.addConnectorCustomizers(connector -> {
            connector.setProperty("relaxedPathChars", "|{}[]\\");
            connector.setProperty("relaxedQueryChars", "|{}[]\\");
        });

        return tomcatServletWebServerFactory;
    }
}
